Don't set time in Ozi if it's not valid.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 18 Jul 2013 17:06:18 +0000 (17:06 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 18 Jul 2013 17:06:18 +0000 (17:06 +0000)
gpsbabel/ozi.cc
gpsbabel/reference/route/ozi~gpx.gpx

index f4dc2c574a23754052f22eeac746c44d961a977d..6dd4b7edf03088387f867f64b6f959233d0a5831 100644 (file)
@@ -163,8 +163,10 @@ ozi_set_time_str(const char *str, waypoint *waypointp)
 {
   double ozi_time = atof(str);
 
-  waypointp->SetCreationTime((ozi_time - DAYS_SINCE_1990) * SECONDS_PER_DAY,
-                              1000000 * (ozi_time - (int) ozi_time));
+  if(ozi_time > DAYS_SINCE_1990) {
+    waypointp->SetCreationTime((ozi_time - DAYS_SINCE_1990) * SECONDS_PER_DAY,
+                               lround(1000000.0 * (ozi_time - (int) ozi_time)));
+  }
 }
 
 static void
index 5347590f80aaaf0e999249e7986593a761337be0..2b15c7e1b0c3a642195950314d4618a5339cb862 100644 (file)
@@ -19,7 +19,6 @@
     <name>1 PCHI COLONIA</name>
     <number>1</number>
     <rtept lat="-34.467500000" lon="-57.854170000">
-      <time>2036-02-05T06:28:16Z</time>
       <name>COLONI</name>
       <cmt>07-OCT-00 18:22</cmt>
       <desc>07-OCT-00 18:22</desc>